import request from '@/config/axios'
import type { Gender } from './types'

export const getGendersListApi = (params: any): Promise<IResponse> => {
  return request.get({ url: '/genders', params })
}

export const createGendersApi = (data: Partial<Gender>): Promise<IResponse> => {
  return request.post({ url: '/genders', data })
}

export const updateGendersApi = (id: string, data: Partial<Gender>): Promise<IResponse> => {
  return request.put({ url: `/genders/id/${id}`, data })
}

export const getGendersDetailApi = (id: string): Promise<IResponse<Gender>> => {
  return request.get({ url: `/genders/id/${id}` })
}

export const delGendersListApi = (ids: string[] | number[]): Promise<IResponse> => {
  return request.delete({ url: `/genders/id/${ids[0]}` })
}
